-
Notifications
You must be signed in to change notification settings - Fork 622
[SDK] Feature: Ox Transaction Envelopes #5598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 16e5347 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
size-limit report 📦
|
| ); | ||
| }); | ||
|
|
||
| test("domain: chainId hex", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the removed test?
| const result = await isValidSignature({ | ||
| contract: options.contract, | ||
| hash: hashTypedData(options.data), | ||
| hash: ox__TypedData.hashStruct({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh types clashed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I'm just trying to use ox as much as possible in the underlying functions, so we don't need to wrap and/or rewrite internal utils we're not planning to export
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i meant the casts underneath this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes they do
.changeset/little-kids-wash.md
Outdated
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "thirdweb": patch | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would make this a minor - lots of underlying changes
| @@ -1,11 +1,13 @@ | |||
| import type { TransactionSerializable } from "viem"; | |||
| import * as ox__Hash from "ox/Hash"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why you dont just import { Hash } from 'ox' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cjs won't treeshake properly if I do, have to import it this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really? ugh
|
|
||
| const tx = parseTransaction(serialized); | ||
| const tx = ox__TransactionEnvelopeEip1559.deserialize( | ||
| serialized as ox__TransactionEnvelopeEip1559.Serialized, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will these cast go away once we migrate everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are just the tests being extra picky because I'm allowing legacy transactions
Merge activity
|
CNCT-2303 Woah. This is sick. <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating the `thirdweb` package to enhance transaction serialization by integrating the `ox` library, renaming files, and refactoring code for better consistency in handling typed data and signatures. ### Detailed summary - Replaced instances of `coinbaseWebSDK.js` with `coinbase-web.js`. - Updated the `parseTypedData` function to handle hex `chainId`. - Refactored signature handling in various files to use `ox` library. - Introduced new types and updated existing ones for better type safety. - Added tests for `parseTypedData` functionality. - Adjusted imports across multiple files to reflect new structure. - Enhanced error handling and validation for typed data signatures. > The following files were skipped due to too many changes: `packages/thirdweb/src/adapters/ethers5.test.ts`, `packages/thirdweb/src/utils/hashing/hashTypedData.ts`, `packages/thirdweb/src/wallets/coinbase/coinbase-web.test.ts`, `packages/thirdweb/src/transaction/serialize-transaction.ts`, `packages/thirdweb/src/transaction/serialize-transaction.test.ts`, `pnpm-lock.yaml` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
CNCT-2303
Woah. This is sick.
PR-Codex overview
This PR focuses on updating the
thirdwebpackage to improve transaction serialization by using theoxlibrary, along with refactoring and renaming some files and functions for consistency.Detailed summary
coinbaseWebSDK.jstocoinbase-web.jsacross multiple files.parseTypedDatato useparse-typed-data.js.SerializableTransactiontype in various files.SignableMessagetype definition.parseTypedDatafunction to handle hexchainId.sign,signTransaction, andsignTypedDatafunctions to useoxlibrary for signing.